/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package slsBeans;

import EL.ReservationDetails;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Tian
 */
@Stateless
public class ReservationDetailBLO implements ReservationDetailBLORemote {
    
    @PersistenceContext(unitName = "Tunga_EJB3PU")
    private EntityManager em;

    public List<ReservationDetails> getAll()
    {
        String hql = "FROM ReservationDetails";
        Query query = this.em.createQuery(hql);
        List<ReservationDetails> reser = query.getResultList();
        return reser;
    }

    public ReservationDetails getByID(int id)
    {
        ReservationDetails reser = this.em.find(ReservationDetails.class, id);
        return reser;
    }

}
